// 渲染进程使用 remote 需要用 window.require 引入
const remote = window.require('@electron/remote')
const {ipcRenderer, shell, clipboard, nativeImage} = require('electron')

window.addEventListener('DOMContentLoaded', () => {
    ipcRenderer.on('translate', (ev,data) => {
        let explain = document.getElementById('explain');
        let entry = document.getElementById('entry');

        explain.innerText = ''
        entry.innerText = ''
        data.forEach(item=>{
            entry.innerText += item.entry
            explain.innerText += item.explain
        })
    })
})